package com.hh.erp.controller;

import com.hh.erp.service.SysDictDataService;
import com.hh.erp.util.http.AjaxResult;
import com.hh.erp.util.http.LoginUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dictdata")
public class DictDataController {


    @Autowired
    private SysDictDataService dictDataService;

    /**
     *
     * @param dictType
     */
    @GetMapping("/{dictType}")
    public AjaxResult getDictDataInfo(@PathVariable("dictType") String dictType) {
        String token = LoginUtil.getToken();
        List list = dictDataService.getDictDatas(dictType);
        return AjaxResult.success(list);
    }
}
